function* foo(num) {
  const value1 = 100 * num;
  console.log("第一段代码：", value1);
  const n = yield value1;

  const value2 = 200 * n;
  console.log("第二段代码：", value2);
  const count = yield value2;

  const value3 = 300 * count;
  console.log("第三段代码：", value3);
  yield value3;
}
// 生成器上的next方法可以传递参数
const generator = foo(5);

console.log(generator.next());

// 第二段代码，第二次调用next的时候执行的
console.log(generator.next(10));
console.log(generator.next(25));
